﻿using Inovout.Data.Domain;

namespace KuaJing.Orders.Domain
{
    public partial class Order: IEcelOrder
    {
        public Order(string id)
            : base(id)
        {
            this.Items = new DataObjectSet<OrderItem>();
        }

        public virtual decimal TradeAmountWan
        {
            get { return this.TradeAmount / 10000; }
        }
        public virtual decimal TradeAmountYi
        {
            get { return this.TradeAmountWan / 10000; }
        }
        public override bool Equals(DataObject that)
        {
            return base.Equals(that) || (!string.IsNullOrEmpty(this.Code) && this.Code == ((Order)that).Code);
        }
        public override int GetHashCode()
        {
            return string.IsNullOrEmpty(this.Code) ? base.GetHashCode() : this.Code.GetHashCode();
        }
    }
}
